Skip to content

feat(diagnostic): превышение длины ключа индекса для файловой ИБ (#3986) - #4292

Open
erprivalov wants to merge 1 commit into
1c-syntax:developfrom
erprivalov:feature/Issue-3986
Open

feat(diagnostic): превышение длины ключа индекса для файловой ИБ (#3986)#4292
erprivalov wants to merge 1 commit into
1c-syntax:developfrom
erprivalov:feature/Issue-3986

Conversation

@erprivalov

@erprivalov erprivalov commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Описание

Добавлена новая метаданная диагностика FileDbIndexKeyLengthExceeded, которая проверяет физический размер ключей индексов для регистров сведений и регистров расчета.

Платформа 1С может падать с ошибкой СУБД при обновлении конфигурации или переходе в файловый вариант, если суммарный размер ключа индекса превышает лимиты (1920 байт для файловой БД, 900 байт для MS SQL). Данная диагностика позволяет обнаружить эту проблему на этапе написания или проверки кода.

Что реализовано:

  1. Подсчет физического размера типов в байтах по формулам платформы (включая служебные поля _TRef/_RRef и маркеры составных типов).
  2. Автоматический учет системного поля Период (8 байт) для периодических регистров.
  3. Проверка основного индекса регистра (ByDims), состоящего из всех его измерений.
  4. Проверка индивидуальных индексов (измерений и реквизитов, у которых явно включено индексирование).
  5. Параметризация через checkMode (FILE, MSSQL, ALL) для выбора целевой СУБД и возможность переопределить лимит для файловой базы через maxIndexKeyLengthBytes.
  6. Детализированный вывод в сообщении об ошибке (с указанием каждого поля и его вклада в общий размер ключа).

Связанные задачи

Closes #3986

Чеклист

Общие

  • Ветка PR обновлена из develop
  • Отладочные, закомментированные и прочие, не имеющие смысла участки кода удалены
  • Изменения покрыты тестами
  • Обязательные действия перед коммитом выполнены (запускал команду gradlew precommit)

Для диагностик

  • Описание диагностики заполнено для обоих языков (присутствуют файлы для обоих языков, для русского заполнено все подробно, перевод на английский можно опустить)

Дополнительно

Summary by CodeRabbit

  • New Features

    • Added a diagnostic that detects register index keys exceeding supported length limits.
    • Supports separate checks for file-based databases, Microsoft SQL Server, or both.
    • Added configurable maximum index length and localized diagnostic messages.
  • Documentation

    • Added English and Russian documentation with calculation details, configuration options, and examples.
  • Configuration

    • Added schema support for the new diagnostic and its settings.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds the FileDbIndexKeyLengthExceeded metadata diagnostic, configurable FILE/MSSQL checks, localized messages, configuration schema entries, tests, and Russian/English documentation for register index key size calculations.

Changes

File DB index key diagnostics

Layer / File(s) Summary
Diagnostic contract and wiring
src/main/java/.../FileDbIndexKeyLengthExceededDiagnostic.java, src/main/resources/.../configuration/*, src/main/resources/.../diagnostics/*
Defines checkMode and maxIndexKeyLengthBytes, registers the diagnostic configuration, adds localized messages, and updates the test-runner regex representation.
Metadata index analysis and reporting
src/main/java/.../FileDbIndexKeyLengthExceededDiagnostic.java
Calculates register index sizes from periodicity, dimensions, attributes, and value types, then reports FILE and MSSQL limit violations.
Validation and diagnostic documentation
src/test/java/.../FileDbIndexKeyLengthExceededDiagnosticTest.java, docs/diagnostics/FileDbIndexKeyLengthExceeded.md, docs/en/diagnostics/FileDbIndexKeyLengthExceeded.md
Tests all check modes and documents calculation rules, configuration options, examples, and references in Russian and English.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Metadata
  participant Diagnostic
  participant SizeCalculation
  participant Report
  Metadata->>Diagnostic: check register metadata
  Diagnostic->>SizeCalculation: calculate index key byte sizes
  SizeCalculation-->>Diagnostic: return composite and individual index sizes
  Diagnostic->>Report: emit FILE or MSSQL violation
Loading
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes an unrelated schema.json change to codeLens.testRunner.resultPattern, outside the diagnostic scope. Move the regex normalization to a separate PR or revert it here so this change stays focused on FileDbIndexKeyLengthExceeded.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: a new diagnostic for file DB index key length overflow.
Linked Issues check ✅ Passed The PR implements the diagnostic, configuration, docs, and tests described in issue #3986.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🧹 Nitpick comments (2)
docs/diagnostics/FileDbIndexKeyLengthExceeded.md (1)

32-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the complete configuration contract in both languages.

The new maxIndexKeyLengthBytes override and the MSSQL 16-field limit are missing from both diagnostic pages.

  • docs/diagnostics/FileDbIndexKeyLengthExceeded.md#L32-L37: document the file-limit override and the MSSQL field-count restriction in Russian.
  • docs/en/diagnostics/FileDbIndexKeyLengthExceeded.md#L28-L33: document the same behavior in English.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/diagnostics/FileDbIndexKeyLengthExceeded.md` around lines 32 - 37,
Update the configuration sections in
docs/diagnostics/FileDbIndexKeyLengthExceeded.md (lines 32-37) and
docs/en/diagnostics/FileDbIndexKeyLengthExceeded.md (lines 28-33) to document
maxIndexKeyLengthBytes as the file-limit override and state the MSSQL
restriction of no more than 16 fields, providing equivalent complete guidance in
Russian and English.

Source: Coding guidelines

src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnosticTest.java (1)

45-64: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Expand coverage beyond diagnostic counts.

These tests only assert list sizes for one fixture. Add assertions for calculated size, index name, fields, limit, and message content, plus cases for exact/just-over-limit boundaries, maxIndexKeyLengthBytes, periodic registers, composite types, non-periodic registers, and the MSSQL 16-field limit. As per coding guidelines, diagnostic tests must cover edge cases comprehensively.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnosticTest.java`
around lines 45 - 64, Expand the test methods in
FileDbIndexKeyLengthExceededDiagnosticTest around testFileMode, testMssqlMode,
and testAllMode to validate each diagnostic’s calculated size, index name,
fields, limit, and message content rather than only counts. Add focused cases
covering exact and just-over-limit boundaries, maxIndexKeyLengthBytes, periodic
and non-periodic registers, composite types, and the MSSQL 16-field limit,
preserving assertions for the expected diagnostic count and values in each mode.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/diagnostics/FileDbIndexKeyLengthExceeded.md`:
- Around line 1-6: Remove the duplicate H1 diagnostic heading in
FileDbIndexKeyLengthExceeded.md by retaining the generated heading and deleting
the repeated heading under “Описание диагностики,” ensuring the document has
only one top-level title and passes MD024.

In
`@src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java`:
- Around line 130-140: The checkAndReport method must also enforce the MSSQL
16-field limit, not only the byte-size limit. Pass the relevant field count from
the ByDims validation flow into checkAndReport, and add an MSSQL diagnostic when
the count exceeds 16 while preserving the existing byte-limit and FILE checks.
- Around line 82-85: Update the type guard in checkMetadata so analysis
continues only for InformationRegister and CalculationRegister instances, while
returning immediately for all other Register kinds. Preserve the existing
register processing for the two supported types.
- Around line 44-64: The public API in FileDbIndexKeyLengthExceededDiagnostic
needs contract-level Javadoc. Document the class’s supported metadata types,
index-key limits, configuration parameters maxIndexKeyLengthBytes and checkMode,
valid CheckMode values, defaults, and any diagnostic side effects; add Javadoc
to the public class, enum, and exposed configuration members without changing
behavior.
- Around line 135-140: Update checkAndReport in
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java#L135-L140
to pass currentSize to getMessage after the configured limit, preserving
argument order. Add the matching actual-size placeholder to both localized
messages in
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_en.properties#L2-L2
and
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_ru.properties#L2-L2.

In
`@src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json`:
- Around line 765-787: Constrain the FileDbIndexKeyLengthExceeded properties:
add an enum permitting only FILE, MSSQL, and ALL for checkMode, and require
maxIndexKeyLengthBytes to be a non-negative integer by setting its minimum to 0.
Preserve the existing defaults and descriptions.

---

Nitpick comments:
In `@docs/diagnostics/FileDbIndexKeyLengthExceeded.md`:
- Around line 32-37: Update the configuration sections in
docs/diagnostics/FileDbIndexKeyLengthExceeded.md (lines 32-37) and
docs/en/diagnostics/FileDbIndexKeyLengthExceeded.md (lines 28-33) to document
maxIndexKeyLengthBytes as the file-limit override and state the MSSQL
restriction of no more than 16 fields, providing equivalent complete guidance in
Russian and English.

In
`@src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnosticTest.java`:
- Around line 45-64: Expand the test methods in
FileDbIndexKeyLengthExceededDiagnosticTest around testFileMode, testMssqlMode,
and testAllMode to validate each diagnostic’s calculated size, index name,
fields, limit, and message content rather than only counts. Add focused cases
covering exact and just-over-limit boundaries, maxIndexKeyLengthBytes, periodic
and non-periodic registers, composite types, and the MSSQL 16-field limit,
preserving assertions for the expected diagnostic count and values in each mode.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fa0c273f-034d-4fb6-bc20-0bb3aba65f01

📥 Commits

Reviewing files that changed from the base of the PR and between 5d2ee9d and ac1c561.

⛔ Files ignored due to path filters (5)
  • src/test/resources/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.bsl is excluded by !src/test/resources/**
  • src/test/resources/metadata/FileDbIndexKeyLengthExceeded/Configuration.xml is excluded by !src/test/resources/**
  • src/test/resources/metadata/FileDbIndexKeyLengthExceeded/InformationRegisters/ВалидныйРегистрСКороткимиИзмерениями.xml is excluded by !src/test/resources/**
  • src/test/resources/metadata/FileDbIndexKeyLengthExceeded/InformationRegisters/НевалидныйРегистрСДлиннойСтрокой.xml is excluded by !src/test/resources/**
  • src/test/resources/metadata/FileDbIndexKeyLengthExceeded/InformationRegisters/РегистрНарушающийТолькоЛимитMSSQL.xml is excluded by !src/test/resources/**
📒 Files selected for processing (8)
  • docs/diagnostics/FileDbIndexKeyLengthExceeded.md
  • docs/en/diagnostics/FileDbIndexKeyLengthExceeded.md
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/schema.json
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_en.properties
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_ru.properties
  • src/test/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnosticTest.java

Comment on lines +1 to +6
# Превышена максимальная длина ключа индекса (FileDbIndexKeyLengthExceeded)

<!-- Блоки выше заполняются автоматически, не трогать -->
## Описание диагностики

# Превышена максимальная длина ключа индекса (FileDbIndexKeyLengthExceeded)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the duplicate diagnostic heading.

The same H1 appears at Line [1] and Line [6], and markdownlint reports MD024. Keep only the generated heading or rename the second heading so the documentation passes lint.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 6-6: Multiple headings with the same content

(MD024, no-duplicate-heading)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/diagnostics/FileDbIndexKeyLengthExceeded.md` around lines 1 - 6, Remove
the duplicate H1 diagnostic heading in FileDbIndexKeyLengthExceeded.md by
retaining the generated heading and deleting the repeated heading under
“Описание диагностики,” ensuring the document has only one top-level title and
passes MD024.

Source: Linters/SAST tools

Comment on lines +44 to +64
@DiagnosticMetadata(
type = DiagnosticType.ERROR,
severity = DiagnosticSeverity.CRITICAL,
minutesToFix = 30,
tags = {DiagnosticTag.STANDARD, DiagnosticTag.DESIGN, DiagnosticTag.ERROR}
)
@Getter
@Setter
public class FileDbIndexKeyLengthExceededDiagnostic extends AbstractMetadataDiagnostic {

private static final int MSSQL_LIMIT = 900;

@DiagnosticParameter(type = Integer.class, defaultValue = "1920")
private int maxIndexKeyLengthBytes = 1920;

public enum CheckMode {
FILE, MSSQL, ALL
}

@DiagnosticParameter(type = String.class, defaultValue = "ALL")
private CheckMode checkMode = CheckMode.ALL;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add contract-level Javadoc for the public diagnostic API.

The public diagnostic class and its public configuration enum/parameters lack documentation describing supported metadata types, limits, configuration values, and side effects. As per coding guidelines, public Java APIs must document their contracts.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java`
around lines 44 - 64, The public API in FileDbIndexKeyLengthExceededDiagnostic
needs contract-level Javadoc. Document the class’s supported metadata types,
index-key limits, configuration parameters maxIndexKeyLengthBytes and checkMode,
valid CheckMode values, defaults, and any diagnostic side effects; add Javadoc
to the public class, enum, and exposed configuration members without changing
behavior.

Source: Coding guidelines

Comment on lines +82 to +85
public void checkMetadata(MD md) {
if (!(md instanceof Register register)) {
return;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restrict analysis to information and calculation registers.

The guard accepts every Register; only periodicity handling is narrowed to InformationRegister and CalculationRegister. As a result, other register kinds covered by the common base can also be reported, contrary to the diagnostic contract and documentation.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java`
around lines 82 - 85, Update the type guard in checkMetadata so analysis
continues only for InformationRegister and CalculationRegister instances, while
returning immediately for all other Register kinds. Preserve the existing
register processing for the two supported types.

Comment on lines +130 to +140
// Шаг 4: Проверка основного составного индекса (ByDims)
String byDimsDetails = String.join(", ", byDimsFields);
checkAndReport("ByDims", byDimsDetails, mainIndexSize);
}

private void checkAndReport(String indexName, String fieldsDetail, int currentSize) {
if ((checkMode == CheckMode.MSSQL || checkMode == CheckMode.ALL) && currentSize > MSSQL_LIMIT) {
addDiagnostic(getInfo().getMessage(indexName, fieldsDetail, "MSSQL", MSSQL_LIMIT));
}
if ((checkMode == CheckMode.FILE || checkMode == CheckMode.ALL) && currentSize > this.maxIndexKeyLengthBytes) {
addDiagnostic(getInfo().getMessage(indexName, fieldsDetail, "FILE", this.maxIndexKeyLengthBytes));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Enforce the MSSQL 16-field index limit.

checkAndReport validates only the byte limit and receives no field count, so a ByDims index with 17 or more fields can pass when its byte size is at most 900. The PR objective explicitly requires the MSSQL field-count restriction; pass the field count and report this violation as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java`
around lines 130 - 140, The checkAndReport method must also enforce the MSSQL
16-field limit, not only the byte-size limit. Pass the relevant field count from
the ByDims validation flow into checkAndReport, and add an MSSQL diagnostic when
the count exceeds 16 while preserving the existing byte-limit and FILE checks.

Comment on lines +135 to +140
private void checkAndReport(String indexName, String fieldsDetail, int currentSize) {
if ((checkMode == CheckMode.MSSQL || checkMode == CheckMode.ALL) && currentSize > MSSQL_LIMIT) {
addDiagnostic(getInfo().getMessage(indexName, fieldsDetail, "MSSQL", MSSQL_LIMIT));
}
if ((checkMode == CheckMode.FILE || checkMode == CheckMode.ALL) && currentSize > this.maxIndexKeyLengthBytes) {
addDiagnostic(getInfo().getMessage(indexName, fieldsDetail, "FILE", this.maxIndexKeyLengthBytes));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Report the calculated key size in every localized diagnostic message.

The Java call currently does not pass currentSize, while both bundles only render the configured limit. Keep the placeholder and argument order identical across all three sites.

  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java#L135-L140: pass the calculated size to getMessage.
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_en.properties#L2-L2: add a placeholder for the actual size.
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_ru.properties#L2-L2: add the same actual-size placeholder.
📍 Affects 3 files
  • src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java#L135-L140 (this comment)
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_en.properties#L2-L2
  • src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_ru.properties#L2-L2
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java`
around lines 135 - 140, Update checkAndReport in
src/main/java/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic.java#L135-L140
to pass currentSize to getMessage after the configured limit, preserving
argument order. Add the matching actual-size placeholder to both localized
messages in
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_en.properties#L2-L2
and
src/main/resources/com/github/_1c_syntax/bsl/languageserver/diagnostics/FileDbIndexKeyLengthExceededDiagnostic_ru.properties#L2-L2.

Comment on lines +765 to +787
"FileDbIndexKeyLengthExceeded": {
"description": "Index key length limit exceeded",
"default": true,
"type": [
"boolean",
"object"
],
"title": "Index key length limit exceeded",
"properties": {
"checkMode": {
"description": "Limit check mode (FILE, MSSQL, ALL)",
"default": "ALL",
"type": "string",
"title": "Limit check mode (FILE, MSSQL, ALL)"
},
"maxIndexKeyLengthBytes": {
"description": "Maximum index key length (in bytes) for File DB",
"default": 1920,
"type": "integer",
"title": "Maximum index key length (in bytes) for File DB"
}
},
"$id": "#/definitions/FileDbIndexKeyLengthExceeded"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Constrain the new configuration values.

checkMode is only typed as an arbitrary string, so typos and lowercase values pass schema validation and are silently converted to ALL by configure. Also, maxIndexKeyLengthBytes accepts negative integers, which makes every index appear to exceed the configured limit. Add an enum for FILE/MSSQL/ALL and a non-negative minimum for the byte limit.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@src/main/resources/com/github/_1c_syntax/bsl/languageserver/configuration/parameters-schema.json`
around lines 765 - 787, Constrain the FileDbIndexKeyLengthExceeded properties:
add an enum permitting only FILE, MSSQL, and ALL for checkMode, and require
maxIndexKeyLengthBytes to be a non-negative integer by setting its minimum to 0.
Preserve the existing defaults and descriptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[NEW] feat(diagnostics): FileDbIndexKeyLengthExceeded — превышение длины ключа индекса для файловой ИБ

1 participant